<template>
  <div class="regionsContainer">
    <LeftModule class="module">
      <CardSlot :title="'能耗总览'" :width="'471px'">
        <div class="energy">
          <div class="energy_left">
            <div class="energy_box">
              <div class="energy_top">
                <div class="energy_top_l">
                  <img src="@/assets/images/ico_power.png" alt="用电" />
                  <div>用电</div>
                </div>
                <div class="energy_top_r">
                  <div>(单位 kwh)</div>
                </div>
              </div>
              <div class="energy_bottom">
                <div class="energy_list">
                  <div>当日</div>
                  <div>19988.00</div>
                </div>
                <div class="energy_list">
                  <div>当月</div>
                  <div>761085.00</div>
                </div>
                <div class="energy_list">
                  <div>当年</div>
                  <div>38670514.00</div>
                </div>
              </div>
            </div>
          </div>
          <div class="energy_right">
            <div class="energy_box">
              <div class="energy_top">
                <div class="energy_top_l">
                  <img src="@/assets/images/ico_powerall.png" alt="用电" />
                  <div>总能耗</div>
                </div>
                <div class="energy_top_r">
                  <div>(单位 tce)</div>
                </div>
              </div>
              <div class="energy_bottom">
                <div class="energy_list">
                  <div>当日</div>
                  <div>35088.00</div>
                </div>
                <div class="energy_list">
                  <div>当月</div>
                  <div>932547.00</div>
                </div>
                <div class="energy_list">
                  <div>当年</div>
                  <div>66677539.00</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </CardSlot>

      <CardSlot :title="'通讯状态'" :width="'471px'">
        <div class="report">
          <div class="report_box">
            <div
              v-for="(item, index) in reportList"
              :key="index"
              class="report_list"
            >
              <div class="report_title">{{ item.name }}</div>
              <div
                :class="item.state === '正常' ? 'active' : ''"
                class="report_state"
              >
                {{ item.state }}
              </div>
            </div>
          </div>
          <div class="report_more">
            <div @click.stop="console.log('export type')">
              更多设备<img src="@/assets/images/ico_more.png" alt="更多设备" />
            </div>
          </div>
        </div>
      </CardSlot>

      <CardSlot :title="'分合状态'" :width="'471px'">
        <div class="openorclose">
          <div class="openorclose_box">
            <div
              v-for="(item, index) in openorcloseList"
              :key="index"
              class="openorclose_list"
            >
              <div class="openorclose_title">
                <img src="@/assets/images/ico_device_red.png" alt="" />
                <div>{{ item.name }}</div>
              </div>
              <div class="openorclose_state">
                <div>{{ item.state }}</div>
              </div>
            </div>
          </div>
          <div class="openorclose_more">
            <div>
              更多设备<img src="@/assets/images/ico_more.png" alt="更多设备" />
            </div>
          </div>
        </div>
      </CardSlot>

      <CardSlot :title="'噪音'" :width="'471px'">
        <div class="noise">
          <div class="noise_left">
            <img src="@/assets/images/ico_noise.png" alt="" />
            <div>
              当前噪音
              <p>80</p>
              db
            </div>
          </div>
          <div class="noise_right">
            <div id="noise" />
          </div>
        </div>
      </CardSlot>
    </LeftModule>

    <RightModule class="module">
      <CardSlot :title="'烟雾'" :width="'471px'">
        <div class="smoke">
          <div class="smoke_left">
            <img src="@/assets/images/ico_smoke.png" alt="" />
            <div>当前烟雾状态</div>
          </div>
          <div class="smoke_right">
            <div class="smoke_list">
              <img src="@/assets/images/ico_fire.png" alt="" />
              <div class="smoke_title">S1C7上方烟感：</div>
              <div class="smoke_state">无烟</div>
            </div>
            <div class="smoke_list">
              <img src="@/assets/images/ico_fire.png" alt="" />
              <div class="smoke_title">2#变压器上方烟感：</div>
              <div class="smoke_state">无烟</div>
            </div>
            <div class="smoke_list">
              <img src="@/assets/images/ico_fire.png" alt="" />
              <div class="smoke_title">2#变压器上方烟感：</div>
              <div class="smoke_state active">PM2.5 30</div>
            </div>
            <div class="smoke_list">
              <img src="@/assets/images/ico_fire.png" alt="" />
              <div class="smoke_title">3#变压器上方烟感：</div>
              <div class="smoke_state">无烟</div>
            </div>
          </div>
        </div>
      </CardSlot>

      <CardSlot :title="'温度曲线'" :width="'471px'">
        <div id="temperature" class="temperature" />
      </CardSlot>

      <CardSlot :title="'湿度曲线'" :width="'471px'">
        <div id="humidity" class="humidity" />
      </CardSlot>

      <CardSlot :title="'监控设备'" :width="'471px'">
        <div class="monitor">
          <div class="monitor_mark">
            <div class="monitor_mark_left">
              <div>摄像头</div>
              <p>13</p>
            </div>
            <div class="monitor_mark_right">
              <div>
                更多设备<img src="@/assets/images/ico_more.png" alt="" />
              </div>
            </div>
          </div>
          <div class="monitor_box">
            <div class="monitor_left">
              <img src="@/assets/images/camera1.jpg" alt="" />
            </div>
            <div class="monitor_right">
              <img src="@/assets/images/camera1.jpg" alt="" />
            </div>
          </div>
        </div>
      </CardSlot>
    </RightModule>
  </div>

  <div class="skip">
    <div class="skipbox" @click.stop="toPage('/shujukanban')">
      <img src="@/assets/images/img_kanban.png" alt="数据看板" />
      <div>数据看板</div>
    </div>
    <div class="skipbox" @click.stop="toPage('/yicitu')">
      <img src="@/assets/images/img_yicitu.png" alt="一次图" />
      <div>一次图</div>
    </div>
  </div>

  <div class="footMenu">
    <div @click="changeFootMenu" class="fm_actbox">
      <div class="fm_titleAct">{{ footMenu }}</div>
      <div class="fm_ico">
        <img v-if="isAct" src="@/assets/images/ico_down_black.png" alt="">
        <img v-else src="@/assets/images/ico_down_red.png" alt="">
      </div>
    </div>
    <div v-show="isAct" class="fm_box">
      <div v-for="item in menulist" :key="item.id" @click="changeMenuText(item)" class="fm_list">{{ item.text }}</div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted, watch, onUnmounted } from "vue";
import { useRouter } from "vue-router";
import * as echarts from "echarts";
import * as THREE from "three";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader.js";
import LeftModule from "@/components/sidebar/leftSide.vue";
import RightModule from "@/components/sidebar/rightSide.vue";
import CardSlot from "@/components/cardslot/index.vue";

let noiseChart;
let temperatureChart;
let humidityChart;

let three = null;
let controls = null;

let reportList = [
  {
    name: "南制冷1",
    state: "正常"
  },
  {
    name: "1#变压器测湿",
    state: "正常"
  },
  {
    name: "2#变压器测湿",
    state: "正常"
  },
  {
    name: "S2D1-1#进线",
    state: "正常"
  },
  {
    name: "南制冷1",
    state: "正常"
  },
  {
    name: "1#变压器测湿",
    state: "正常"
  },
  {
    name: "2#变压器测湿",
    state: "正常"
  },
  {
    name: "S2D1-1#进线",
    state: "正常"
  },
  {
    name: "南制冷1",
    state: "正常"
  },
  {
    name: "1#变压器测湿",
    state: "正常"
  },
  {
    name: "2#变压器测湿",
    state: "异常"
  },
  {
    name: "S2D1-1#进线",
    state: "异常"
  }
];

let openorcloseList = [
  {
    name: "S1A4-1-15F低区客梯1(主供)",
    state: "由分转合"
  },
  {
    name: "S1A4-2-15F低区客梯2(主供)",
    state: "由分转合"
  },
  {
    name: "S1A4-3-4F低区客梯(备供)转换电梯",
    state: "由分转合"
  },
  {
    name: "S1A4-1-15F低区客梯3(主供)",
    state: "高压保护动作"
  },
  {
    name: "S1A4-1-15F低区客梯4(主供)",
    state: "高压保护复归"
  }
];

// 噪音
const initNoise = () => {
  if (noiseChart != null && noiseChart != "" && noiseChart != undefined) {
    noiseChart.dispose();
  }
  noiseChart = echarts.init(document.getElementById("noise"));
  noiseChart.clear();
  let option = {
    tooltip: {
      trigger: "axis"
    },
    grid: {
      top: "25%",
      left: "3%",
      right: "4%",
      bottom: "3%",
      containLabel: true
    },
    xAxis: {
      type: "category",
      data: ["1日9时", "1日10时", "1日11时", "1日12时", "1日13时"],
      nameTextStyle: {
        color: "#333"
      },
      // boundaryGap: false,
      axisLine: {
        lineStyle: {
          color: "#ccc"
        }
      },
      splitLine: {
        lineStyle: {
          color: "#ccc"
        }
      },
      axisTick: {
        show: false
      },
      axisLabel: {
        color: "#333"
      }
    },
    yAxis: {
      type: "value",
      name: "kw",
      nameTextStyle: {
        color: "#333"
      },
      axisLabel: {
        // formatter: '{value}'
        color: "#333"
      }
    },
    series: [
      {
        name: "",
        type: "line",
        data: [12, 24, 13, 28, 17, 15, 19, 20, 14],
        smooth: false,
        itemStyle: {
          opacity: 0
        },
        lineStyle: {
          color: "RGBA(124, 167, 231, 1)"
        },
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: "RGBA(124, 167, 231, 1)"
            },
            {
              offset: 0.8,
              color: "RGBA(124, 167, 231, 0)"
            }
          ])
        }
      }
    ]
  };

  option && noiseChart.setOption(option);
};

// 温度
const initTemperature = () => {
  if (
    temperatureChart != null &&
    temperatureChart != "" &&
    temperatureChart != undefined
  ) {
    temperatureChart.dispose();
  }
  temperatureChart = echarts.init(document.getElementById("temperature"));
  temperatureChart.clear();
  let option = {
    tooltip: {
      trigger: "axis"
    },
    grid: {
      top: "25%",
      left: "3%",
      right: "4%",
      bottom: "3%",
      containLabel: true
    },
    xAxis: {
      type: "category",
      data: ["1日9时", "1日10时", "1日11时", "1日12时", "1日13时"],
      nameTextStyle: {
        color: "#333"
      },
      axisLine: {
        lineStyle: {
          color: "#ccc"
        }
      }
    },
    yAxis: {
      type: "value",
      name: "°C",
      nameTextStyle: {
        color: "#333"
      }
    },
    series: [
      {
        name: "",
        type: "line",
        data: [12, 24, 13, 28, 17, 15, 19, 20, 14],
        smooth: true,
        itemStyle: {
          opacity: 0
        },
        lineStyle: {
          color: "RGBA(124, 167, 231, 1)"
        },
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: "RGBA(124, 167, 231, 1)"
            },
            {
              offset: 0.8,
              color: "RGBA(124, 167, 231, 0)"
            }
          ])
        }
      }
    ]
  };

  option && temperatureChart.setOption(option);
};

// 湿度
const initHumidity = () => {
  if (
    humidityChart != null &&
    humidityChart != "" &&
    humidityChart != undefined
  ) {
    humidityChart.dispose();
  }
  humidityChart = echarts.init(document.getElementById("humidity"));
  humidityChart.clear();
  let option = {
    tooltip: {
      trigger: "axis"
    },
    grid: {
      top: "25%",
      left: "3%",
      right: "4%",
      bottom: "3%",
      containLabel: true
    },
    xAxis: {
      type: "category",
      data: ["1日9时", "1日10时", "1日11时", "1日12时", "1日13时"],
      nameTextStyle: {
        color: "#333"
      },
      axisLine: {
        lineStyle: {
          color: "#ccc"
        }
      }
    },
    yAxis: {
      type: "value",
      name: "%RH",
      nameTextStyle: {
        color: "#333"
      }
    },
    series: [
      {
        name: "",
        type: "line",
        data: [12, 24, 13, 28, 17, 15, 19, 20, 14],
        smooth: true,
        itemStyle: {
          opacity: 0
        },
        lineStyle: {
          color: "rgba(120, 254, 240, 1)"
        },
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: "rgba(120, 254, 240, 1)"
            },
            {
              offset: 0.5,
              color: "rgba(120, 254, 240, 0)"
            }
          ])
        }
      }
    ]
  };

  option && humidityChart.setOption(option);
};

// 模型
const initThree = () => {
  three = window.three;
  controls = window.three.controls;

  const GLBLoader = new GLTFLoader();
  const dracoLoader = new DRACOLoader();
  dracoLoader.setDecoderPath("/draco/");
  dracoLoader.setDecoderConfig({ type: "js" });
  GLBLoader.setDRACOLoader(dracoLoader);
  GLBLoader.load(
    "/gltf/f3.glb",
    gltf => {
      gltf.scene.scale.set(2.8, 2.8, 2.8);
      gltf.scene.position.set(0, -1.5, -1.5);
      gltf.scene.rotation.set(0, 0, 0);
      changeMaterialEmissive(gltf.scene);
      three.scene.add(gltf.scene);
    },
    progressEvent => {
      const { loaded, total, lengthComputable } = progressEvent;
      if (lengthComputable) {
      } else {
      }
    },
    error => {
      console.log("error:", error);
    }
  );

  animate();
};

const changeMaterialEmissive = parent => {
  parent.traverse(function (obj) {
    if (obj instanceof THREE.Mesh) {
      obj.material.emissive = obj.material.color;
      obj.material.opacity = 0.6;
      obj.material.emissiveIntensity = 0.8;
      obj.material.emissiveMap = obj.material.map;
      obj.material.side = THREE.DoubleSide;
      obj.castShadow = true;
      obj.receiveShadow = true;
      obj.frustumCulled = false;
    }
  });
};

const animate = () => {
  requestAnimationFrame(animate);
  controls.update();
  three?.renderer?.render(three.scene, three.camera);
};

const resizeCharts = () => {
  setTimeout(() => {
    noiseChart?.resize();
    temperatureChart?.resize();
    humidityChart?.resize();
  }, 300);
};

const removeGltf = () => {
  cancelAnimationFrame(animate);
  three.scene.clear();
  three.renderer.content = null;
  three?.renderer.dispose();
  three?.scene.children.forEach(child => {
    three.scene.remove(child);
  });

  // 清理内存中的模型数据
  three?.scene.traverse(child => {
    if (child.isMesh) {
      child.geometry.dispose();
      if (child.material) {
        const material = Array.isArray(child.material)
          ? child.material
          : [child.material];
        material.forEach(mat => mat.dispose());
      }
    }
  });
};

const router = useRouter();
const toPage = url => {
  router.push(url);
};

// 菜单
const menulist = [
  {
    id: 0,
    text: "北31楼"
  },
  {
    id: 1,
    text: "南31楼"
  },
  {
    id: 2,
    text: "北中心"
  },
  {
    id: 3,
    text: "南中心"
  },
  {
    id: 4,
    text: "北制冷"
  },
  {
    id: 5,
    text: "南制冷"
  }
];

// 底部菜单
const isAct = ref(false);
const changeFootMenu = () => {
  isAct.value = !isAct.value;
}
let footMenu = menulist[0].text;
const changeMenuText = item => {
  footMenu = item.text;
  isAct.value = !isAct.value;
}

let resizeObserver;

onMounted(() => {
  initThree();
  initNoise();
  initTemperature();
  initHumidity();

  window.addEventListener("resize", resizeCharts, false);
  const viewElem = document.getElementsByClassName("regionsContainer")[0]; // document.body;
  resizeObserver = new ResizeObserver(() => {
    noiseChart?.resize();
    temperatureChart?.resize();
    humidityChart?.resize();
  });
  resizeObserver.observe(viewElem);
});

onUnmounted(() => {
  noiseChart?.dispose();
  temperatureChart?.dispose();
  humidityChart?.dispose();

  removeGltf();
  if (resizeObserver) {
    resizeObserver.disconnect();
  }
  window.removeEventListener("resize", resizeCharts, false);
});
</script>

<style scoped lang="scss">
.module {
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  justify-content: space-between;

  .cardslot {
    height: 100%;
  }
}

.energy {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;

  .energy_left {
    flex: 1;
    border-right: 1px solid #eee;
  }

  .energy_right {
    flex: 1;
  }

  .energy_box {
    padding: 0 15px;

    .energy_top {
      display: flex;
      // align-items: center;
      align-items: last baseline;
      justify-content: space-between;

      .energy_top_l {
        display: flex;
        align-items: center;

        img {
          width: 51px;
          height: 43px;
        }

        div {
          margin-left: 6px;
          font-size: 20px;
          font-weight: bold;
          line-height: 20px;
          color: #333;
        }
      }

      .energy_top_r {
        font-size: 12px;
        line-height: 12px;
        color: #333;
      }
    }

    .energy_bottom {
      padding-top: 20px;

      .energy_list {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 10px;
        padding-left: 14px;

        &:last-child {
          padding-bottom: 0;
        }

        div {
          &:first-child {
            font-size: 14px;
            line-height: 14px;
            color: #333;
          }

          &:last-child {
            font-size: 20px;
            font-weight: bold;
            line-height: 20px;
            color: #0759d2;
          }
        }
      }
    }
  }
}

.report {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;

  .report_box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    .report_list {
      width: 23%;
      margin: 1%; //5px;
      text-align: center;
      background-color: #efeee8;
      border-radius: 5px;

      .report_title {
        padding: 5px 0;
        font-size: 12px;
        line-height: 12px;
        color: #fff;
        background-color: #1764d5;
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
      }

      .report_state {
        padding: 5px 0;
        font-size: 14px;
        font-weight: bold;
        line-height: 14px;
        color: #ff4d4f;

        &.active {
          color: #1764d5;
        }
      }
    }
  }

  .report_more {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    div {
      font-size: 12px;
      line-height: 12px;
      color: #333;
      cursor: pointer;
      img {
        padding-left: 5px;
      }
    }
  }
}

.openorclose {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;

  .openorclose_box {
    display: flex;
    flex-flow: column wrap;
    align-items: center;

    .openorclose_list {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding-left: 10px;
      margin-bottom: 10px;

      .openorclose_title {
        display: flex;
        align-items: baseline;
        width: 80%;
        overflow: hidden;
        font-size: 14px;
        line-height: 14px;
        color: #333;
        text-overflow: ellipsis;
        white-space: nowrap;

        img {
          width: 14px;
          height: 14px;
          margin-right: 8px;
        }
      }

      .openorclose_state {
        font-size: 14px;
        line-height: 14px;
        color: #1764d5;
      }
    }
  }

  .openorclose_more {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    div {
      font-size: 12px;
      line-height: 12px;
      color: #333;
      cursor: pointer;

      img {
        padding-left: 5px;
      }
    }
  }
}

.noise {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;

  .noise_left {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;

    img {
      width: 108px;
      height: 127px;
    }

    div {
      display: flex;
      align-items: baseline;
      margin-top: 14px;
      font-size: 14px;
      line-height: 14px;
      color: #333;

      p {
        padding: 0 5px;
        font-size: 20px;
        color: #f00;
        font-weight: bold;
      }
    }
  }

  .noise_right {
    flex: 3;
    width: 100%;
    height: 100%;

    #noise {
      width: 100%;
      height: 100%;
    }
  }
}

.smoke {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;

  .smoke_left {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;

    img {
      width: 114px;
      height: 123px;
      margin-right: 13px;
    }

    div {
      display: flex;
      align-items: baseline;
      margin-top: 14px;
      font-size: 14px;
      line-height: 14px;
      color: #333;
    }
  }

  .smoke_right {
    flex: 2;

    .smoke_list {
      display: flex;
      align-items: center;
      margin-top: 15px;

      img {
        width: 20px;
        height: 20px;
        margin-right: 5px;
      }

      .smoke_title {
        font-size: 14px;
        line-height: 14px;
        color: #333;
      }

      .smoke_state {
        padding: 0 5px;
        font-size: 16px;
        font-weight: bold;
        line-height: 16px;
        color: #1764d5;

        &.active {
          color: #f00;
        }
      }
    }
  }
}

.temperature {
  width: 100%;
  height: 100%;
}

.humidity {
  width: 100%;
  height: 100%;
}

.monitor {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  width: 100%;
  height: 100%;

  .monitor_mark {
    width: 100%;
    height: 28px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 5px 10px;

    .monitor_mark_left {
      display: flex;
      align-items: center;
      font-size: 16px;
      line-height: 16px;

      p {
        color: #2479ee;
        font-weight: bold;
        padding-left: 5px;
      }
    }

    .monitor_mark_right {
      font-size: 12px;
      line-height: 12px;
      cursor: pointer;
      display: flex;
      align-items: center;

      img {
        padding-left: 5px;
      }
    }
  }

  .monitor_box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;

    .monitor_left,
    .monitor_right {
      flex: 1;
      padding: 0 5px;
      height: 100%;

      img {
        width: 100%;
        height: 100%;
      }
    }
  }
}

.skip {
  position: fixed;
  bottom: 50px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  .skipbox {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-image: url("@/assets/images/img_bottom_bg.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 91px 91px;
    width: 91px;
    height: 91px;
    margin: 0 10px;

    div {
      margin-top: 8px;
      font-size: 14px;
      line-height: 14px;
    }
  }
}

.region_menu {
  position: fixed;
  top: 95px;
  left: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, 0);
  background-image: url("@/assets/images/ico_menu_bot.png");
  background-repeat: no-repeat;
  background-position: bottom;
  background-size: 100% 1px;
  width: 35%;

  .menu_list {
    // position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    // width: 120px;
    // height: 54px;
    // margin: 0 5px;
    font-size: 16px;
    cursor: pointer;
    margin: 0 3px;

    img {
      width: 100%;
      height: 100%;
    }

    .menu_text {
      // position: absolute;
      // top: 50%;
      // left: 50%;
      font-size: 18px;
      line-height: 18px;
      color: #333;
      white-space: nowrap;
      // transform: translate(-50%, -50%);
      padding: 13px 19px;

      &.active {
        // color: #fff;
        font-weight: bold;
        border-bottom: 3px solid var(--main-color);
      }
    }
  }
}

.footMenu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  background-image: url("@/assets/images/ico_fmbg.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;

  .fm_actbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 0);
    // width: 335px;
    width: 18vw;
    height: 32px;

    .fm_titleAct {
      font-size: 14px;
      line-height: 14px;
      color: #333;
      text-align: center;
      width: 100%;
      // margin-bottom: 8px;
    }

    .fm_ico {
      width: 8px;
      height: 4px;
      position: absolute;
      right: 30px;
      bottom: 12px;

      img {
        width: 100%;
        height: 100%;
        display: block;
      }
    }
  }

  .fm_box {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translate(-50%, 0);
    transition: all 1s linear;

    .fm_list {
      background-image: url("@/assets/images/ico_fm_listbg.png");
      background-repeat: no-repeat;
      background-size: 100% 100%;
      // width: 335px;
      width: 18vw;
      height: 35px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      color: #333;
      cursor: pointer;
      margin-top: 5px;
    }
  }
}
</style>
